<?php
/**
* 跳转信息
* @author wolf <lang.feng@zol.com.cn>
* @copyright (c)
*/

class Admin_Page_PopMsg extends ME_Abstract_Page
{
	 public function validate(ME_Request $input, ME_Response $output)
	{
		$input->msg     = $input->get('msg');
		$input->type    = $input->get('type');
		$input->timeout = (int)$input->get('timeout');
		$input->stop    = (int)$input->get('stop');
		$input->backurl = $input->get('backurl') ? $input->get('backurl') :
				(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '');

		$output->headerHtml = Admin_Plugin_Common_Tpl::getHeader($input, $output);
        
		return true;
	}

	public function doDefault(ME_Request $input, ME_Response $output)
	{
		$msgtype = array('success', 'error', 'failure');
		$type             = ($input->type && array_key_exists($input->type, $msgtype)) ? $input->type : 'error';

		$output->type    = $input->type;
		$output->title    = $input->msg ? $input->msg : '';
		$output->msg      = $input->msg ? $input->msg : '';
		$output->timeout  = $input->timeout;
		$output->stop  = $input->stop;
		$output->backurl  = $input->backurl;
		$output->setTemplate('PopMsg');
	}

}